export const drawer_config = () => {
    const config = {
        show: false,
        title: "新增部门",
        direction: "rtl",
        size: "30%",
        labelWidth: "90px",
        messageBox: {
            status: true,
            title: "提示",
            message: "是否保存当前数据？",
            confirmButtonText: '保存',
            cancelButtonText: '放弃',
            type: 'warning', // success
            confirmEventName: "save",
            cancelEventName: null
        },
        ifSave: true,
        form: [
            {
                key: "deptId",
                type: "hidden",
            },
            {
                key: "parentId",
                type: "treeSelect",
                label: "上级菜单",
                alert: "",
                options: [],
                props: {value: "deptId", label: "deptName"}
            },
            {key: "deptName", type: "text", label: "部门名称", alert: ""},
            {key: "orderNum", type: "number", label: "显示排序", min: 0, max: 999, alert: ""},
            {key: "leader", type: "text", label: "负责人", alert: ""},
            {key: "phone", type: "text", label: "联系电话", alert: ""},
            {key: "email", type: "text", label: "联系邮箱", alert: ""},
            {
                key: "status",
                type: "radio",
                label: "部门状态",
                source: "dict", //source: dict字典查询/select 数据来源方向
                dict: "sys_normal_disable"
            }

        ],
        //https://github.com/yiminghe/async-validator
        rules: {
            deptName: [
                {required: true, message: '请输入目录名称', trigger: 'blur'},
                {min: 2, max: 50, message: '长度需要2-9个汉字', trigger: 'blur'},
            ],
            orderNum: [
                {required: true, message: '请输入显示排序', trigger: 'blur'},
            ]
        }
    }
    return config
}